package com.gm.springboot.mapper;

import com.gm.springboot.bean.Major;
import com.gm.springboot.bean.Manga;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: 阮渝轩
 * @Date: 2020/7/4 11:01
 * @Version 1.0
 */
public interface MangaMapper {
    @Select("select * from manga")
    List<Manga> findMangaAll();
    @Delete("delete from manga where mid=#{mid}")
    int delManga(Integer mid);
    @Insert("insert into manga(mname,cartoonist,chapters,publisher) values(#{mname},#{cartoonist},#{chapters},#{publisher})")
    int addManga(Manga manga);
    @Select("select * from manga where mid=#{mid}")
    Manga findMangaById(Integer mid);
    @Update("update manga set mname=#{mname},cartoonist=#{cartoonist},chapters=#{chapters},publisher=#{publisher} where mid=#{mid}")
    int updManga(Manga manga);
}
